#include "server.h"
#include "ui_server.h"
//#include <QtNetwork>
#include <QDebug>
#include <qsqltablemodel.h>
#include <QSqlTableModel>
#include <QSqlTableModel>
#include <QTableView>
//#include <QtSql>

server::server(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
 //   tcpServer = new QTcpServer(this);
  //  client = new QTcpSocket(this);

    //tcpServer->listen(QHostAddress::LocalHost, 27015);
    //qDebug() << "Server up: " << tcpServer->serverAddress() << " " << tcpServer->serverPort();
    QSqlTableModel *CandidateTable = new QSqlTableModel;
    CandidateTable->setTable("Candidates");
    CandidateTable->select();
    CandidateTable->removeColumn(0);
    CandidateTable->setHeaderData(0, Qt::Horizontal, tr("Candidate"));
    CandidateTable->setHeaderData(1, Qt::Horizontal, tr("Total Votes"));


}




server::~server()
{
    delete ui;
}


